import 'package:flutter/material.dart';


class ChatCell extends StatelessWidget {

  final String name;

  final String image;

  final String message;

  ChatCell(this.name, this.image, this.message, {super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 80,
      margin: EdgeInsets.all(5),
      decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(5)
      ),
      child: Row(
        children: [Image.asset('images/nanhai.png'),Column(
          children: [
            Text(name,style: TextStyle(fontSize: 18),),
            Text(message,style: TextStyle(color: Colors.grey),)
          ],
        )],
      ),
    );
  }

  factory ChatCell.fromMap(Map map) {
    return ChatCell(map['name'], map['image'], map['message']);
  }


}